function wpestate_start_filtering_ajax_map(newpage,pan_ne_lat, pan_ne_long, pan_sw_lat,pan_sv_long,move_map){ "use strict"; is_fit_bounds_zoom=1; map_geo_first_load=1; var ajaxurl,all_fields,all_checkers,city,area,country,property_admin_area,stype,search_location_filter_autointernal,all_checkers,postid,keyword_search; all_fields=new Array(); ajaxcalls_vars.adv_search_what_half.forEach(function(element){ if(element==='property_price'){ all_fields.push({element:'price_low',value: parseInt(jQuery('#price_low').val(), 10)}); all_fields.push({element:'price_max',value:parseInt(jQuery('#price_max').val(), 10) }); }else{ all_fields.push({element:element.toLowerCase(),value:jQuery('#'+element.toLowerCase()).val() }); }}); if(ajaxcalls_vars.adv_search_type==='type4'){ all_fields.push({element:'property_category',value:jQuery('#property_category').val() }); all_fields.push({element:'property_action_category',value:jQuery('#property_action_category').val() }); } if(jQuery('#search_location_city').length >0){ city=jQuery('#search_location_city').val(); } if(jQuery('#advanced_city').length >0){ city=jQuery('#advanced_city').val(); } if(jQuery('#search_location_area').length>0){ area=jQuery('#search_location_area').val(); } if(jQuery('#advanced_area').length>0){ area=jQuery('#advanced_area').val(); } if(jQuery('#search_location_country').length>0){ country=jQuery('#search_location_country').val(); } if(jQuery('#advanced_area').length>0){ country=jQuery('#advanced_country').val(); } property_admin_area=jQuery('#property_admin_area').val(); stype=jQuery('#stype').val(); search_location_filter_autointernal=jQuery('#search_location_autointernal').val(); all_checkers=''; jQuery('#extended_search_check_filter input[type="checkbox"]').each(function (){ if(jQuery(this).is(":checked")){ all_checkers=all_checkers + "," + jQuery(this).attr("id"); }}); postid=parseInt(jQuery('#adv-search-1').attr('data-postid'), 10); if(isNaN(postid)){ postid=parseInt(jQuery('#adv_extended_options_text_adv').attr('data-pageid'), 10); } if(jQuery('#keyword_search').length > 0){ keyword_search=jQuery('#keyword_search').val(); } var geo_lat=''; var geo_long=''; var geo_rad=''; if(jQuery("#geolocation_search").length > 0){ geo_lat=jQuery('#geolocation_lat').val(); geo_long=jQuery('#geolocation_long').val(); geo_rad=jQuery('#geolocation_radius').val(); } ajaxurl=ajaxcalls_vars.admin_url + 'admin-ajax.php'; jQuery('#listing_ajax_container').empty(); jQuery('#listing_loader').show(); var nonce=jQuery('#wprentals_ajax_filtering').val(); jQuery.ajax({ type: 'POST', url: ajaxurl, dataType: 'json', data: { 'action':'wpestate_custom_ondemand_pin_load_new', 'search_location':search_location_filter_autointernal, 'all_fields':all_fields, 'stype':stype, 'advanced_city':city, 'advanced_area':area, 'advanced_country':country, 'property_admin_area':property_admin_area, 'all_checkers':all_checkers, 'newpage':newpage, 'postid':postid, 'keyword_search':keyword_search, 'geo_lat':geo_lat, 'geo_long':geo_long, 'geo_rad':geo_rad, 'pan_ne_lat':pan_ne_lat, 'pan_ne_long':pan_ne_long, 'pan_sw_lat':pan_sw_lat, 'pan_sv_long':pan_sv_long, 'move_map':move_map, 'security':nonce, }, success: function (data){ jQuery('#advanced_search_map_list').removeClass('movetofixed'); jQuery('#listing_loader').hide(); jQuery('.listing_loader_title').show(); jQuery('#listing_ajax_container').empty().append(data.response); jQuery('.pagination_nojax').remove(); wpestate_restart_js_after_ajax(); wpestate_lazy_load_carousel_property_unit(); var new_markers=jQuery.parseJSON(data.markers); if(infoBox!==null){ infoBox.close(); } if(typeof(move_map)!=='undefined'){ wpestate_set_filter_pins_ondemand (map, new_markers); }else{ wpestate_set_filter_pins(map, new_markers); } is_fit_bounds_zoom=0; if(jQuery("#geolocation_search").length > 0&&initial_geolocation_circle_flag===0){ var place_lat=jQuery('#geolocation_lat').val(); var place_lng=jQuery('#geolocation_long').val(); if(place_lat!==''&&place_lng!=''){ initial_geolocation_circle_flag=1; wpestate_geolocation_marker(place_lat,place_lng); }} }, error: function (errorThrown){}}); } function wpestate_geolocation_marker (place_lat, place_lng){ var place_radius; if(control_vars.geo_radius_measure==='miles'){ place_radius=parseInt(jQuery('#geolocation_radius').val(),10)*1609.34 ; }else{ place_radius=parseInt(jQuery('#geolocation_radius').val(),10)*1000 ; } if(wprentals_map_type===1){ var place_position=new google.maps.LatLng(place_lat, place_lng); map.setCenter(place_position); if(placeCircle!=''){ placeCircle.setMap(null); placeCircle=''; } marker=new google.maps.Marker({ map: map, position: place_position, icon: mapfunctions_vars.path+'/poi/location.png' }); var populationOptions={ strokeColor: '#67cfd8', strokeOpacity: 0.6, strokeWeight: 1, fillColor: '#1CA8DD', fillOpacity: 0.2, map: map, center: place_position, radius: parseInt(place_radius,10) }; placeCircle=new google.maps.Circle(populationOptions); map.fitBounds(placeCircle.getBounds()); }else if(wprentals_map_type===2){ var markerCenter=L.latLng(place_lat, place_lng); map.panTo(markerCenter); if(map.hasLayer(circleLayer)){ map.removeLayer(circleLayer); } var markerImage={ iconUrl: mapfunctions_vars.path+'/poi/location.png', iconSize: [28, 38], iconAnchor: [10, 19], popupAnchor: [1, -18] }; var markerOptions={ riseOnHover: true }; if(map.hasLayer(circleLayer)){ map.removeLayer(circleLayer); } circleLayer=L.featureGroup(); markerOptions.icon=L.icon(markerImage); L.marker(markerCenter, markerOptions).addTo(map); placeCircle=L.circle(markerCenter, parseInt(place_radius,10)).addTo(circleLayer); map.addLayer(circleLayer); map.fitBounds(placeCircle.getBounds()); }} function wpestate_get_custom_value(slug){ var value; var is_drop=0; if(slug==='adv_categ'||slug==='adv_actions'||slug==='advanced_city'||slug==='advanced_area'||slug==='county-state'){ value=jQuery('#'+slug).attr('data-value'); }else if(slug==='property_price'&&mapfunctions_vars.slider_price==='yes'){ value=jQuery('#price_low').val(); }else if(slug==='property-country'){ value=jQuery('#advanced_country').attr('data-value'); }else{ if(jQuery('#'+slug).hasClass('filter_menu_trigger')){ value=jQuery('#'+slug).attr('data-value'); is_drop=1; }else{ value=jQuery('#half-'+slug).val() ; }} if(typeof(value)!=='undefined'&&is_drop===0){ } return value; } function wpestate_start_filtering_ajax(newpage){ "use strict"; var action, guest_no, country, check_out, check_in, category, city, area, rooms, baths, min_price, price_max, ajaxurl, postid; action=jQuery('#adv_actions').attr('data-value'); category=jQuery('#adv_categ').attr('data-value'); city=jQuery('#advanced_city').attr('data-value'); area=jQuery('#advanced_area').attr('data-value'); country=jQuery('#advanced_country').attr('data-value'); rooms=parseInt(jQuery('#adv_rooms').val(), 10); baths=parseInt(jQuery('#adv_bath').val(), 10); min_price=parseInt(jQuery('#price_low').val(), 10); price_max=parseInt(jQuery('#price_max').val(), 10); postid=parseInt(jQuery('#adv-search-1').attr('data-postid'), 10); check_in=jQuery('#check_in').val(); check_out=jQuery('#check_out').val(); guest_no=jQuery('#guest_no_main').val(); ajaxurl=ajaxcalls_vars.admin_url + 'admin-ajax.php'; jQuery('#listing_ajax_container').empty(); jQuery('.listing_loader_title').show(); jQuery('#internal-loader').show(); var nonce=jQuery('#wprentals_ajax_filtering').val(); jQuery.ajax({ type: 'POST', url: ajaxurl, data: { 'action':'wpestate_ajax_filter_listings_search', 'action_values':action, 'category_values':category, 'city':city, 'area':area, 'advanced_rooms':rooms, 'advanced_bath':baths, 'price_low':min_price, 'price_max':price_max, 'newpage':newpage, 'postid':postid, 'check_in':check_in, 'check_out':check_out, 'guest_no':guest_no, 'country':country, 'security':nonce, }, success: function (data){ jQuery('#internal-loader,#listing_loader').hide(); jQuery('#listing_ajax_container').addClass('load_from_ajax').empty().append(data); wpestate_restart_js_after_ajax(); }, error: function (errorThrown){ }}); } function wpestate_restart_js_after_ajax(){ "use strict"; var newpage, post_id, post_image, to_add, icon, already_in, i, bLazy; jQuery('.property_listing').on('click',function (event){ var link, classevent; classevent=jQuery(event.target); if(classevent.hasClass('carousel-control')||classevent.hasClass('icon-left-open-big')||classevent.hasClass('icon-right-open-big')){ return; } link=jQuery(this).attr('data-link'); window.open(link, '_self'); }); jQuery('#google_map_prop_list_sidebar .listing_wrapper').unbind('hover'); jQuery("#google_map_prop_list_sidebar .listing_wrapper").on("hover", function(e){ if(e.type==="mouseenter"){ var listing_id=jQuery(this).attr('data-listid'); wpestate_hover_action_pin(listing_id); }else if(e.type==="mouseleave"){ var listing_id=jQuery(this).attr('data-listid'); wpestate_return_hover_action_pin(listing_id); }}); jQuery('.prop-compare:first-of-type').remove(); jQuery('.pagination_ajax_search a').on('click',function (event){ event.preventDefault(); newpage=parseInt(jQuery(this).attr('data-future'), 10); document.getElementById('scrollhere').scrollIntoView(); wpestate_start_filtering_ajax(newpage); }); jQuery('.pagination_ajax a').on('click',function (event){ event.preventDefault(); newpage=parseInt(jQuery(this).attr('data-future'), 10); document.getElementById('scrollhere').scrollIntoView(); wpestate_start_filtering(newpage); }); jQuery('.pagination_ajax_search_home a').on('click',function (event){ event.preventDefault(); newpage=parseInt(jQuery(this).attr('data-future'), 10); document.getElementById('scrollhere').scrollIntoView(); if(googlecode_regular_vars.on_demand_pins==='yes'&&map_is_moved===1){ wpestate_reload_pins_onmap(newpage); }else{ wpestate_start_filtering_ajax_map(newpage); }}); already_in=[]; jQuery('.compare-action').on('click',function (e){ e.preventDefault(); e.stopPropagation(); jQuery('.prop-compare').show(); post_id=jQuery(this).attr('data-pid'); for (i=0; i < already_in.length; i++){ if(already_in[i]===post_id){ return; }} already_in.push(post_id); post_image=jQuery(this).attr('data-pimage'); to_add=''; jQuery('div.items_compare:first-child').css('background', 'red'); if(parseInt(jQuery('.items_compare').length, 10) > 3){ jQuery('.items_compare:first').remove(); } jQuery('#submit_compare').before(to_add); jQuery('.items_compare').fadeIn(800); }); jQuery('#submit_compare').on('click',function (){ jQuery('#form_compare').trigger('submit'); }); jQuery('.icon-fav').on('click',function (event){ event.stopPropagation(); icon=jQuery(this); wpestate_add_remove_favorite(icon); }); jQuery(".share_list, .icon-fav, .compare-action").on("hover", function(e){ if(e.type==="mouseenter"){ jQuery(this).tooltip('show'); }else if(e.type==="mouseleave"){ jQuery(this).tooltip('hide'); }}); jQuery('.share_list').on('click',function (){ var sharediv=jQuery(this).parent().find('.share_unit'); sharediv.toggle(); jQuery(this).toggleClass('share_on'); }); wpestate_lazy_load_carousel_property_unit(); } function wpestate_add_remove_favorite(icon){ "use strict"; var post_id, securitypass, ajaxurl; post_id=icon.attr('data-postid'); securitypass=jQuery('#security-pass').val(); ajaxurl=ajaxcalls_vars.admin_url + 'admin-ajax.php'; if(parseInt(ajaxcalls_vars.userid, 10)===0){ wpestate_show_login_form(1, 1, 0); }else{ icon.toggleClass('icon-fav-off'); icon.toggleClass('icon-fav-on'); var nonce=jQuery('#wprentals_ajax_filtering').val(); jQuery.ajax({ type: 'POST', url: ajaxurl, dataType: 'json', data: { 'action':'wpestate_ajax_add_fav', 'post_id':post_id, 'security':nonce }, success: function (data){ if(data.added){ icon.removeClass('icon-fav-off').addClass('icon-fav-on'); icon.attr('data-original-title',ajaxcalls_vars.remove_favorite); }else{ icon.removeClass('icon-fav-on').addClass('icon-fav-off'); icon.attr('data-original-title',ajaxcalls_vars.add_favorite_unit); }}, error: function (errorThrown){ }}); }} function wpestate_resend_for_approval(prop_id, selected_div){ "use strict"; var ajaxurl, normal_list_no; ajaxurl=control_vars.admin_url + 'admin-ajax.php'; var nonce=jQuery('#wprentals_property_actions').val(); jQuery.ajax({ type: 'POST', url: ajaxurl, data: { 'action':'wpestate_ajax_resend_for_approval', 'propid':prop_id, 'security':nonce }, success: function (data){ if(data==='pending'){ selected_div.parent().empty().append('Sent for approval'); normal_list_no=parseInt(jQuery('#normal_list_no').text(), 10); jQuery('#normal_list_no').text(normal_list_no - 1); }else{ selected_div.parent().empty().append(data); }}, error: function (errorThrown){ }}); } function wpestate_make_prop_featured(prop_id, selectedspan){ "use strict"; var ajaxurl=ajaxcalls_vars.admin_url + 'admin-ajax.php'; var nonce=jQuery('#wprentals_property_actions').val(); jQuery.ajax({ type: 'POST', url: ajaxurl, data: { 'action':'wpestate_ajax_make_prop_featured', 'propid':prop_id, 'security':nonce, }, success: function (data){ if(data.trim()==='done'){ selectedspan.empty().html('' + ajaxcalls_vars.prop_featured + ''); selectedspan.removeClass('dashboad-tooltip'); var featured_list_no=parseInt(jQuery('#featured_list_no').text(), 10); jQuery('#featured_list_no').text(featured_list_no - 1); }else{ selectedspan.empty().removeClass('make_featured').addClass('featured_exp').removeClass('dashboad-tooltip').text(ajaxcalls_vars.no_prop_featured); }}, error: function (errorThrown){ }}); } function wpestate_recuring_pay_pack_via_paypal(){ "use strict"; var ajaxurl, packName, packId; ajaxurl=control_vars.admin_url + 'admin-ajax.php'; packName=jQuery('#pack_select :selected').text(); packId=jQuery('#pack_select :selected').val(); var nonce=jQuery('#wprentals_payments_actions').val(); jQuery.ajax({ type: 'POST', url: ajaxurl, data: { 'action':'wpestate_ajax_paypal_pack_recuring_generation_rest_api', 'packName':packName, 'packId':packId, 'security':nonce, }, success: function (data){ window.location.href=data; }, error: function (errorThrown){ }}); } function wpestate_pay_pack_via_paypal(){ "use strict"; var ajaxurl, packName, packId; ajaxurl=control_vars.admin_url + 'admin-ajax.php'; packName=jQuery('#pack_select :selected').text(); packId=jQuery('#pack_select :selected').val(); var nonce=jQuery('#wprentals_payments_actions').val(); jQuery.ajax({ type: 'POST', url: ajaxurl, data: { 'action':'wpestate_ajax_paypal_pack_generation', 'packName':packName, 'packId':packId, 'security':nonce }, success: function (data){ window.location.href=data; }, error: function (errorThrown){ }}); } function wpestate_listing_pay(prop_id, selected_div, is_featured, is_upgrade){ "use strict"; var ajaxurl=control_vars.admin_url + 'admin-ajax.php'; var nonce=jQuery('#wprentals_payments_actions').val(); jQuery.ajax({ type: 'POST', url: ajaxurl, data: { 'action':'wpestate_ajax_listing_pay', 'propid':prop_id, 'is_featured':is_featured, 'is_upgrade':is_upgrade, 'security':nonce }, success: function (data){ window.location.href=data; }, error: function (errorThrown){ }}); } function wpestate_start_filtering(newpage){ "use strict"; jQuery('#grid_view').addClass('icon_selected'); jQuery('#list_view').removeClass('icon_selected'); var action, category, city, area, order, ajaxurl, page_id; action=jQuery('#a_filter_action').attr('data-value'); category=jQuery('#a_filter_categ').attr('data-value'); city=jQuery('#a_filter_cities').attr('data-value'); area=jQuery('#a_filter_areas').attr('data-value'); order=jQuery('#a_filter_order').attr('data-value'); ajaxurl=ajaxcalls_vars.admin_url + 'admin-ajax.php'; page_id=jQuery('#page_idx').val(); jQuery('#listing_ajax_container').empty(); jQuery('#listing_loader').show(); var nonce=jQuery('#wprentals_ajax_filtering').val(); jQuery.ajax({ type: 'POST', url: ajaxurl, data: { 'action':'wpestate_ajax_filter_listings', 'action_values':action, 'category_values':category, 'city':city, 'area':area, 'order':order, 'newpage':newpage, 'page_id':page_id, 'security':nonce }, success: function (data){ jQuery('#listing_loader').hide(); jQuery('#listing_ajax_container').empty().append(data); jQuery('.pagination_nojax').hide(); wpestate_restart_js_after_ajax(); wpestate_lazy_load_carousel_property_unit(); }, error: function (errorThrown){ }}); } function wpestate_show_login_form(type, ispop, propid){ "use strict"; if(parseInt(type,10)===1){ jQuery('#ajax_login_div').show(); jQuery('#ajax_register_div').hide(); }else{ jQuery('#ajax_login_div').hide(); jQuery('#ajax_register_div').show(); } if(parseInt(ispop,10)===9){ jQuery('#loginmodal .login-links').hide(); } jQuery('#loginmodal').modal(); wpestate_enable_actions_modal(); } function wpestate_change_pass_profile(){ "use strict"; var oldpass, newpass, renewpass, securitypass, ajaxurl; oldpass=jQuery('#oldpass').val(); newpass=jQuery('#newpass').val(); renewpass=jQuery('#renewpass').val(); securitypass=jQuery('#security-pass').val(); ajaxurl=ajaxcalls_vars.admin_url + 'admin-ajax.php'; jQuery.ajax({ type: 'POST', url: ajaxurl, data: { 'action':'wpestate_ajax_update_pass', 'oldpass':oldpass, 'newpass':newpass, 'renewpass':renewpass, 'security-pass':securitypass }, success: function (data){ jQuery('#profile_pass').empty().append('
' + data + '
'); jQuery('#oldpass, #newpass, #renewpass').val(''); }, error: function (errorThrown){ }}); } function wpestate_register_wd(){ "use strict"; var user_pass,user_pass_retype,capthca, user_login_register, user_email_register, nonce, ajaxurl,user_type; user_login_register=jQuery('#user_login_register_wd').val(); user_email_register=jQuery('#user_email_register_wd').val(); nonce=jQuery('#wpestate_ajax_log_reg').val(); user_pass=jQuery('#user_password_wd').val(); user_pass_retype=jQuery('#user_password_retype_wd').val(); ajaxurl=ajaxcalls_vars.admin_url + 'admin-ajax.php'; user_type=jQuery("input[name=acc_type]:checked").val(); if(!jQuery('#user_terms_register_wd').is(":checked")){ jQuery('#register_message_area_wd').empty().append(''); return; } capthca=''; if(control_vars.usecaptcha==='yes'){ capthca=grecaptcha.getResponse(widgetId3 ); } jQuery.ajax({ type: 'POST', url: ajaxurl, dataType: 'json', data: { 'action':'wpestate_ajax_register_form', 'user_login_register':user_login_register, 'user_email_register':user_email_register, 'user_type':user_type, 'tipul':2, 'capthca':capthca, 'user_pass':user_pass, 'user_pass_retype':user_pass_retype, 'security':nonce, }, success: function (data){ if(data.register===true){ jQuery('#register_message_area_wd').empty().append(''); }else{ jQuery('#register_message_area_wd').empty().append(''); } jQuery('#user_login_register_wd').val(''); jQuery('#user_email_register_wd').val(''); }, error: function (errorThrown){ }}); } function wpestate_register_wd_mobile(){ "use strict"; var user_pass,user_pass_retype,capthca,user_login_register, user_email_register, nonce, ajaxurl,user_type; user_login_register=jQuery('#user_login_register_wd_mobile').val(); user_email_register=jQuery('#user_email_register_wd_mobile').val(); nonce=jQuery('#wpestate_ajax_log_reg').val(); ajaxurl=ajaxcalls_vars.admin_url + 'admin-ajax.php'; user_type=jQuery("input[name=acc_type]:checked").val(); user_pass=jQuery('#user_password_wd_mobile').val(); user_pass_retype=jQuery('#user_password_retype_wd_mobile').val(); if(!jQuery('#user_terms_register_wd_mobile').is(":checked")){ jQuery('#register_message_area_wd_mobile').empty().append(''); return; } capthca=''; if(control_vars.usecaptcha==='yes'){ capthca=grecaptcha.getResponse(widgetId2 ); } jQuery.ajax({ type: 'POST', url: ajaxurl, dataType: 'json', data: { 'action':'wpestate_ajax_register_form', 'user_login_register':user_login_register, 'user_email_register':user_email_register, 'security-register':nonce, 'user_type':user_type, 'tipul':1, 'capthca':capthca, 'user_pass':user_pass, 'user_pass_retype':user_pass_retype, 'security':nonce, }, success: function (data){ if(data.register===true){ jQuery('#register_message_area_wd_mobile').empty().append(''); }else{ jQuery('#register_message_area_wd_mobile').empty().append(''); } jQuery('#user_login_register_wd_mobile').val(''); jQuery('#user_email_register_wd_mobile').val(''); }, error: function (errorThrown){ }}); } function wpestate_forgot(type){ "use strict"; var forgot_email, securityforgot, postid, ajaxurl; postid=jQuery('#postid').val(); ajaxurl=ajaxcalls_vars.admin_url + 'admin-ajax.php'; if(type===1){ forgot_email=jQuery('#forgot_email_mod').val(); securityforgot=jQuery('#security-login-forgot_wd').val(); } if(type===2){ forgot_email=jQuery('#forgot_email_mod').val(); securityforgot=jQuery('#security-forgot').val(); } if(type===3){ forgot_email=jQuery('#forgot_email').val(); securityforgot=jQuery('#security-login-forgot_wd').val(); } if(type===4){ forgot_email=jQuery('#forgot_email_mobile').val(); securityforgot=jQuery('#security-login-forgot_wd_mobile').val(); } var nonce=jQuery('#wpestate_ajax_log_reg').val(); jQuery.ajax({ type: 'POST', url: ajaxurl, data: { 'action':'wpestate_ajax_forgot_pass', 'forgot_email':forgot_email, 'security-forgot':securityforgot, 'postid':postid, 'type':type, 'security':nonce }, success: function (data){ if(type===1){ jQuery('#forgot_email_mod').val(''); jQuery('#forgot_pass_area_shortcode').empty().append('